1. Field of Invention
The present invention relates to a method and a device for compression by conditional encoding of digital image signals without loss of data.
2. Description of the Prior Art
In the prior art, the French patent application 8318132 describes a method for the compression of digital data representing the pixels of a digitalized image. This method gives a good rate of compression without loss of data while previous methods gave worthwhile compression rates but with a certain deterioration of the image, hence with loss of information, which rules out its use for radiographic pictures in medicine.
However, in certain uses, for example when obtaining digitalized angiographic images, which have to be stored by taking up as little memory as possible and at video rate, the compression rates obtained by the method of the said French patent application are not sufficient. Furthermore, the article by H. Gharavi, "Conditional Variable-length Encoding for Gray-level Pictures", published in the BSTJ, volume 63, No. 2., Feb. 1984, describes a method for compression by conditional encoding, but this method is based on an image, the digitalization of which (on three bits) induces a distortion with respect to the original image.
3. Summary of the Invention
The object of the present invention is a method for the compression of digital data by which it is possible to obtain a high compression rate without loss of data, and its object is also a device for the application of this method, which is simple and inexpensive to make.
The method of the present invention consists in making a conditional encoding for each pixel of the digitalized image by assigning a variable-length code to each current pixel, taking into account its value and the values of at least two neighbouring pixels. According to an advantageous feature of the invention, the various codes are combined into a smaller number of encoding classes which all exhibit substantially the same probability of appearance, and several values of less frequently occurring codes, which are distinguished by a suffix, are combined under one and the same prefix.
The device to apply the invention essentially comprises a random-access memory which memorizes the values of successive pixels of an analyzed image, the number of pixels being at least equal to the number of pixels contained in one line of this image, this random-access memory being connected to a converter device which gives numbers of encoding classes according to the respective values of the pixels neighbouring the standard pixel, this converter device being connected to a encoding device which, according to the numbers of the classes referred to above, gives corresponding variable-length codes.
In order to enable the codes of successive pixels of an analyzed image to be memorized, the device of the invention comprises a concatenation formatter which essentially comprises a register with parallel inputs, the serial output of which is connected to a serial input of another register of the same capacity with parallel outputs, the inputs of the first of these registers being connected to the said encoding device and the outputs of the second register being connected to a bulk memory, the said encoding device comprising a variable-length code length output connected by a controller to a clock which is itself connected to the clock signal inputs of the two registers and to a counter with a number of counting states equal to the capacity of each of the two registers, the output of this counter, actuated upon the arrival of the last counting state, being connected to the validation command input for the outputs of the second register referred to above.